import 'package:equatable/equatable.dart';

class EmailVerificationCode extends Equatable {
  const EmailVerificationCode({
    required this.value,
    required this.email,
    required this.expirationTime,
    required this.remainingAttempts,
  });

  final String value;
  final String email;
  final DateTime expirationTime;
  final int remainingAttempts;

  @override
  List<Object?> get props {
    return [
      value,
      email,
      expirationTime,
      remainingAttempts,
    ];
  }

  EmailVerificationCode copyWith({
    String Function()? value,
    String Function()? email,
    DateTime Function()? expirationTime,
    int Function()? remainingAttempts,
  }) {
    return EmailVerificationCode(
      value: value == null ? this.value : value(),
      email: email == null ? this.email : email(),
      expirationTime: expirationTime == null ? this.expirationTime : expirationTime(),
      remainingAttempts: remainingAttempts == null ? this.remainingAttempts : remainingAttempts(),
    );
  }
}
